/**
 * jims
 */
package com.jims.master.modules.finance.service;

import com.jims.master.common.persistence.Page;
import com.jims.master.common.service.CrudService;
import com.jims.master.common.web.impl.BaseDto;
import com.jims.master.modules.finance.dao.OutpBillItemsDao;
import com.jims.master.modules.finance.entity.OutpAcctMaster;
import com.jims.master.modules.finance.entity.OutpBillItems;
import com.jims.master.modules.finance.entity.OutpRcptMaster;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

/**
 * 门诊收费记录明细Service
 * @author chentao
 * @version 2017-03-06
 */
@Service
@Transactional(readOnly = true)
public class OutpBillItemsService extends CrudService<OutpBillItemsDao, OutpBillItems> {

	public OutpBillItems get(String id) {
		return super.get(id);
	}
	
	public List<OutpBillItems> findList(OutpBillItems outpBillItems) {
		return super.findList(outpBillItems);
	}
	
	public Page<OutpBillItems> findPage(Page<OutpBillItems> page, OutpBillItems outpBillItems) {
		return super.findPage(page, outpBillItems);
	}
	
	@Transactional(readOnly = false)
	public int save(OutpBillItems outpBillItems) {
		return super.save(outpBillItems);
	}
	
	@Transactional(readOnly = false)
	public int delete(OutpBillItems outpBillItems) {
		return super.delete(outpBillItems);
	}

	/**
	 * 门诊结账--查询收费明细
	 * @param page
	 * @param outpAcctMaster
	 * @return Page<OutpBillItems>
	 * @author 赵宁
	 */
	public Page<OutpBillItems> getBillItems(Page<OutpBillItems> page,OutpAcctMaster outpAcctMaster){
		return  page.setList(dao.findItems(outpAcctMaster));
	}

	/**
	 * 根据收费主记录id查询明细
	 * @param page
	 * @param rcptMasterId
	 * @return  Page<OutpBillItems>
	 * @author 赵宁
	 */
	public Page<OutpBillItems> findListItems(Page<OutpBillItems> page,String rcptMasterId){
		return  page.setList(dao.findListRcpt(rcptMasterId));
	}

    /**
     * 根据月份查询收费数据
     * @param orgId 机构id
     * @param startDate 开始时间
     * @param endDate 结束时间
     * @return
     */
    public List<BaseDto> queryMonthList(String orgId,Date startDate,Date endDate) {
        return dao.queryMonthList(orgId,startDate,endDate);
    }



}